package cn.lingyangwl.agile.food.model.entity;

import cn.lingyangwl.agile.model.BasePO;
import cn.lingyangwl.agile.common.datasource.core.type.StringListTypeHandler;
import cn.lingyangwl.agile.tenant.core.DataIsolation;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 商品规格值
 *
 * @author shenguangyang
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName(value = "food_goods_spec_value", autoResultMap = true)
@DataIsolation(filterMainTenant = true, tableName = "food_goods_spec_value")
public class GoodsSpecValue extends BasePO {
    @TableId
	private Long id;
	
	/**
	 * 商品id
	 */
	private Long goodsId;

	/**
	 * 规格名称
	 */
	private String name;
	
	/**
	 * 选择的规格值
	 */
	@TableField(value = "value", typeHandler = StringListTypeHandler.class)
	private List<String> values;
	
	/**
	 * 规格id
	 */
	private Long specId;

    public static LambdaQueryWrapper<GoodsSpecValue> lqw() {
		return Wrappers.lambdaQuery();
	}
}
